/**
 * Software License, Version 1.0
 * 
 * Copyright 2003 The Trustees of Indiana University.  All rights reserved.
 * 
 *
 *Redistribution and use in source and binary forms, with or without 
 *modification, are permitted provided that the following conditions are met:
 *
 *1) All redistributions of source code must retain the above copyright notice,
 * the list of authors in the original source code, this list of conditions and
 * the disclaimer listed in this license;
 *2) All redistributions in binary form must reproduce the above copyright 
 * notice, this list of conditions and the disclaimer listed in this license in
 * the documentation and/or other materials provided with the distribution;
 *3) Any documentation included with all redistributions must include the 
 * following acknowledgement:
 *
 *"This product includes software developed by the Community Grids Lab. For 
 * further information contact the Community Grids Lab at 
 * http://communitygrids.iu.edu/."
 *
 * Alternatively, this acknowledgement may appear in the software itself, and 
 * wherever such third-party acknowledgments normally appear.
 * 
 *4) The name Indiana University or Community Grids Lab or NaradaBrokering, 
 * shall not be used to endorse or promote products derived from this software 
 * without prior written permission from Indiana University.  For written 
 * permission, please contact the Advanced Research and Technology Institute 
 * ("ARTI") at 351 West 10th Street, Indianapolis, Indiana 46202.
 *5) Products derived from this software may not be called NaradaBrokering, 
 * nor may Indiana University or Community Grids Lab or NaradaBrokering appear
 * in their name, without prior written permission of ARTI.
 * 
 *
 * Indiana University provides no reassurances that the source code provided 
 * does not infringe the patent or any other intellectual property rights of 
 * any other entity.  Indiana University disclaims any liability to any 
 * recipient for claims brought by any other entity based on infringement of 
 * intellectual property rights or otherwise.  
 *
 *LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH NO 
 *WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA UNIVERSITY GIVES
 *NO WARRANTIES AND MAKES NO REPRESENTATION THAT SOFTWARE IS FREE OF 
 *INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER PROPRIETARY RIGHTS. 
 *INDIANA UNIVERSITY MAKES NO WARRANTIES THAT SOFTWARE IS FREE FROM "BUGS", 
 *"VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", OR OTHER HARMFUL CODE.  
 *LICENSEE ASSUMES THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
 *ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION 
 *GENERATED USING SOFTWARE.
 */
/*
 * XML Type:  OperatorContentType
 * Namespace: http://schemas.xmlsoap.org/ws/2004/09/policy
 * Java type: cgl.narada.wsinfra.schemas.policy.OperatorContentType
 *
 * Automatically generated - do not modify.
 */
package cgl.narada.wsinfra.schemas.policy.impl;
/**
 * An XML OperatorContentType(@http://schemas.xmlsoap.org/ws/2004/09/policy).
 *
 * This is a complex type.
 */
public class OperatorContentTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements cgl.narada.wsinfra.schemas.policy.OperatorContentType
{
    
    public OperatorContentTypeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName POLICY$0 = 
        new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "Policy");
    private static final javax.xml.namespace.QName ALL$2 = 
        new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "All");
    private static final javax.xml.namespace.QName EXACTLYONE$4 = 
        new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "ExactlyOne");
    private static final javax.xml.namespace.QName POLICYREFERENCE$6 = 
        new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyReference");
    
    
    /**
     * Gets array of all "Policy" elements
     */
    public cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy[] getPolicyArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(POLICY$0, targetList);
            cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy[] result = new cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "Policy" element
     */
    public cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy getPolicyArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy target = null;
            target = (cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy)get_store().find_element_user(POLICY$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "Policy" element
     */
    public int sizeOfPolicyArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(POLICY$0);
        }
    }
    
    /**
     * Sets array of all "Policy" element
     */
    public void setPolicyArray(cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy[] policyArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(policyArray, POLICY$0);
        }
    }
    
    /**
     * Sets ith "Policy" element
     */
    public void setPolicyArray(int i, cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy policy)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy target = null;
            target = (cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy)get_store().find_element_user(POLICY$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(policy);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "Policy" element
     */
    public cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy insertNewPolicy(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy target = null;
            target = (cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy)get_store().insert_element_user(POLICY$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "Policy" element
     */
    public cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy addNewPolicy()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy target = null;
            target = (cgl.narada.wsinfra.schemas.policy.PolicyDocument.Policy)get_store().add_element_user(POLICY$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "Policy" element
     */
    public void removePolicy(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(POLICY$0, i);
        }
    }
    
    /**
     * Gets array of all "All" elements
     */
    public cgl.narada.wsinfra.schemas.policy.OperatorContentType[] getAllArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(ALL$2, targetList);
            cgl.narada.wsinfra.schemas.policy.OperatorContentType[] result = new cgl.narada.wsinfra.schemas.policy.OperatorContentType[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "All" element
     */
    public cgl.narada.wsinfra.schemas.policy.OperatorContentType getAllArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.OperatorContentType target = null;
            target = (cgl.narada.wsinfra.schemas.policy.OperatorContentType)get_store().find_element_user(ALL$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "All" element
     */
    public int sizeOfAllArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ALL$2);
        }
    }
    
    /**
     * Sets array of all "All" element
     */
    public void setAllArray(cgl.narada.wsinfra.schemas.policy.OperatorContentType[] allArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(allArray, ALL$2);
        }
    }
    
    /**
     * Sets ith "All" element
     */
    public void setAllArray(int i, cgl.narada.wsinfra.schemas.policy.OperatorContentType all)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.OperatorContentType target = null;
            target = (cgl.narada.wsinfra.schemas.policy.OperatorContentType)get_store().find_element_user(ALL$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(all);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "All" element
     */
    public cgl.narada.wsinfra.schemas.policy.OperatorContentType insertNewAll(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.OperatorContentType target = null;
            target = (cgl.narada.wsinfra.schemas.policy.OperatorContentType)get_store().insert_element_user(ALL$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "All" element
     */
    public cgl.narada.wsinfra.schemas.policy.OperatorContentType addNewAll()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.OperatorContentType target = null;
            target = (cgl.narada.wsinfra.schemas.policy.OperatorContentType)get_store().add_element_user(ALL$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "All" element
     */
    public void removeAll(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ALL$2, i);
        }
    }
    
    /**
     * Gets array of all "ExactlyOne" elements
     */
    public cgl.narada.wsinfra.schemas.policy.OperatorContentType[] getExactlyOneArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(EXACTLYONE$4, targetList);
            cgl.narada.wsinfra.schemas.policy.OperatorContentType[] result = new cgl.narada.wsinfra.schemas.policy.OperatorContentType[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "ExactlyOne" element
     */
    public cgl.narada.wsinfra.schemas.policy.OperatorContentType getExactlyOneArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.OperatorContentType target = null;
            target = (cgl.narada.wsinfra.schemas.policy.OperatorContentType)get_store().find_element_user(EXACTLYONE$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "ExactlyOne" element
     */
    public int sizeOfExactlyOneArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(EXACTLYONE$4);
        }
    }
    
    /**
     * Sets array of all "ExactlyOne" element
     */
    public void setExactlyOneArray(cgl.narada.wsinfra.schemas.policy.OperatorContentType[] exactlyOneArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(exactlyOneArray, EXACTLYONE$4);
        }
    }
    
    /**
     * Sets ith "ExactlyOne" element
     */
    public void setExactlyOneArray(int i, cgl.narada.wsinfra.schemas.policy.OperatorContentType exactlyOne)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.OperatorContentType target = null;
            target = (cgl.narada.wsinfra.schemas.policy.OperatorContentType)get_store().find_element_user(EXACTLYONE$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(exactlyOne);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "ExactlyOne" element
     */
    public cgl.narada.wsinfra.schemas.policy.OperatorContentType insertNewExactlyOne(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.OperatorContentType target = null;
            target = (cgl.narada.wsinfra.schemas.policy.OperatorContentType)get_store().insert_element_user(EXACTLYONE$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "ExactlyOne" element
     */
    public cgl.narada.wsinfra.schemas.policy.OperatorContentType addNewExactlyOne()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.OperatorContentType target = null;
            target = (cgl.narada.wsinfra.schemas.policy.OperatorContentType)get_store().add_element_user(EXACTLYONE$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "ExactlyOne" element
     */
    public void removeExactlyOne(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(EXACTLYONE$4, i);
        }
    }
    
    /**
     * Gets array of all "PolicyReference" elements
     */
    public cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference[] getPolicyReferenceArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(POLICYREFERENCE$6, targetList);
            cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference[] result = new cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "PolicyReference" element
     */
    public cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference getPolicyReferenceArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference target = null;
            target = (cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference)get_store().find_element_user(POLICYREFERENCE$6, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "PolicyReference" element
     */
    public int sizeOfPolicyReferenceArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(POLICYREFERENCE$6);
        }
    }
    
    /**
     * Sets array of all "PolicyReference" element
     */
    public void setPolicyReferenceArray(cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference[] policyReferenceArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(policyReferenceArray, POLICYREFERENCE$6);
        }
    }
    
    /**
     * Sets ith "PolicyReference" element
     */
    public void setPolicyReferenceArray(int i, cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference policyReference)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference target = null;
            target = (cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference)get_store().find_element_user(POLICYREFERENCE$6, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(policyReference);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "PolicyReference" element
     */
    public cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference insertNewPolicyReference(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference target = null;
            target = (cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference)get_store().insert_element_user(POLICYREFERENCE$6, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "PolicyReference" element
     */
    public cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference addNewPolicyReference()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference target = null;
            target = (cgl.narada.wsinfra.schemas.policy.PolicyReferenceDocument.PolicyReference)get_store().add_element_user(POLICYREFERENCE$6);
            return target;
        }
    }
    
    /**
     * Removes the ith "PolicyReference" element
     */
    public void removePolicyReference(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(POLICYREFERENCE$6, i);
        }
    }
}
